﻿Imports Exp.Model
Imports Exp.DATA_Service

Public Class BasePage
    Inherits System.Web.UI.Page

    Private Sub Page_Init(sender As Object, e As EventArgs) Handles MyBase.Init

        If Session("USER") Is Nothing Then

            Dim uname As String = ConfigurationManager.AppSettings("FORCELOGIN.UNAME")
            Dim paswd As String = ConfigurationManager.AppSettings("FORCELOGIN.PASWD")

            If uname IsNot Nothing AndAlso paswd IsNot Nothing AndAlso uname IsNot String.Empty AndAlso paswd IsNot String.Empty Then

                paswd = GetDataUtil.getMD5Hash(paswd)

                Dim objUs As New Exp.DATA_Service.User_Service

                Dim objUser = objUs.GetByUserPss(uname, paswd)

                If Not objUser Is Nothing Then
                    Session("USER") = objUser

                End If

            End If

        End If


    End Sub

End Class
